import java.util.ArrayList;

public class TestArrayList {
  public static void main(String[] args) {
    // Create a list to store cities
    ArrayList<String> studentList = new ArrayList<>();

    // Add some cities in the list
    studentList.add("张三");
    // cityList now contains [张三]
    studentList.add("李四");
    // cityList now contains [张三, 李四]
    studentList.add("王五");
    // cityList now contains [张三, 李四, 王五]
    studentList.add("e");
    // cityList now contains [张三, 李四, 王五, e]
    studentList.add("b");
    // contains [张三, 李四, 王五, e,b]
    studentList.add("a");
    // contains [张三, 李四, 王五, e,b,a]

    System.out.println("学生总数? " + studentList.size());
    System.out.println("Is 王五 in the list? " +
      studentList.contains("王五"));
    System.out.println("The location of Denver in the list? "
      + studentList.indexOf("学生e的排列下标是"));
    System.out.println("学生表不包含有学生? " +
      studentList.isEmpty()); // Print false

    // Insert a new student at index 2
    studentList.add(2, "王五");
    // contains [张三, 李四, 王五, e, b, a]

    // Remove a student from the list
    studentList.remove("no");
    // contains [张三, 李四, 王五, e, b]

    // Remove a student at index 1
    studentList.remove(1);
    // contains [张三, 李四, 王五, e]

    // Display the contents in the list
    System.out.println(studentList.toString());

    // Display the contents in the list in reverse order
    for (int i = studentList.size() - 1; i >= 0; i--)
      System.out.print(studentList.get(i) + " ");
    System.out.println();
    
//    // Create a list to store two circles
//    ArrayList<CircleFromSimpleGeometricObject> list
//      = new ArrayList<>();
//
//    // Add two circles
//    list.add(new CircleFromSimpleGeometricObject(2));
//    list.add(new CircleFromSimpleGeometricObject(3));
//
//    // Display the area of the first circle in the list
//    System.out.println("The area of the circle? " +
//      list.get(0).getArea());
  }
}